<template>
  <div id="goodsinfo" :class="[this.fun.getPhoneEnv() == 3 ? 'pcStyle' : '']">
    <c-title :hide="false" :text="$i18n.t('base.confirmOrder')"></c-title>
    <!--配送方式填写-->
    <div v-if="!hideDispatch">
      <!-- hideDispatch 为true后下单页隐藏配送方式，关闭则显示。【默认地址插件default-address】-->
      <!-- 门店预约填写联系人 联系手机 -->
      <van-cell-group inset class="margin-top-10" v-if="root_tag == 'reserve' && delivery_information == 1">
        <van-field v-model="reserveName" label="联系人" placeholder="请填写联系人姓名" />
        <van-field v-model="reservePhone" label="联系手机" placeholder="请输入联系人电话" />
      </van-cell-group>

      <!--聚合cps-->
      <van-cell-group inset class="margin-top-10"  v-if="is_cps && cpsType == '1'">
        <van-field required label="账号" v-model="cpsTxt" placeholder="请输入手机号码或者账号" />
      </van-cell-group>

      <!-- 快递 -->
      <van-cell-group inset class="t-l margin-top-10" v-if="selected == '0' && !show_address && !ele_no_showAdress || $route.query.tag == 'cake'">
        <!--虚拟商品需要配送地址-->
        <van-cell class="padding-10" icon="location-o" is-link :label="`${realname} ${mobile}`" @click="showAddressFun">
          <template #title>
            <div class="f-16 f-bold">{{ realname? address : $i18n.t('base.pleaseSelectAddress')}}</div>
          </template>
        </van-cell>
      </van-cell-group>

      <!-- 接口返回的配送方式 start -->
      <template v-if="dispatch.length > 0 && !show_address && !ele_no_showAdress &&  $route.query.tag != 'cake' ">
        <van-tabs v-model="selected" @click="requestByAddress" :ellipsis="false" :title-active-color="'var(--themeBaseColor)'" :color="'var(--themeBaseColor)'">
          <van-tab v-show="dispatch.length > 0" v-for="item in dispatch" :name="item.dispatch_type_id" :key="item.dispatch_type_id" :title="item.name"></van-tab>
        </van-tabs>
      </template>

      <div v-show="selected == item.dispatch_type_id && !show_address && !ele_no_showAdress" v-for="item in dispatch" :key="item.dispatch_type_id">
        <template v-if="selected == '10'">
          <van-cell-group inset class="t-l margin-top-10">
            <van-cell class="padding-10" icon="location-o" is-link @click="tolocation">
              <template #title>
                <div class="f-16 f-bold">{{ supp_point.address || '收货地址'}}</div>
              </template>
            </van-cell>
            <p class="dis_warn f-12" style="margin: 0 10px 10px;">注：订单配送是根据下单时的定位进行配送，不按照收货地址配送，请注意选择正确地址！</p>
          </van-cell-group>
        </template>

        <template v-if="selected == '1' || selected == '10' || selected == 'same' || selected == 'delivery'|| selected == 16">
          <!-- 快递 -->
          <van-cell-group inset class="t-l margin-top-10" v-if="!show_address">
            <van-cell class="padding-10" icon="location-o" is-link :label="`${realname} ${mobile}`" @click="showAddressFun">
              <template #title>
                <div class="f-16 f-bold">{{ realname? address : $i18n.t('base.pleaseSelectAddress')}}</div>
              </template>
            </van-cell>
          </van-cell-group>
        </template>

        <template v-if="selected == '2'">
          <!-- 门店自提 -->
          <van-cell-group inset class="t-l margin-top-10" >
            <van-cell class="padding-10" icon="location-o"
              :label="`${store_carry.area ||'自提地点'} ${store_info.store_name} ${store_info.store_mobile}`">
              <template #title>
                <div class="f-16 f-bold">{{ store_info.store_address }}</div>
              </template>
            </van-cell>

            <template v-if="store_info.delivery_information == null || store_info.delivery_information == 1">
              <van-field v-model="linkinfo.name" :label="store_carry.name" :placeholder="'请输入' + store_carry.name" center clearable input-align='right' :border='false'/>
              <van-field v-model="linkinfo.mobile" :label="store_carry.number" :placeholder="'请输入' + store_carry.number" center clearable input-align='right' :border='false'/>
              <p class="dis_warn f-12" style="margin: 0 10px 10px;">友情提示：请核对手机号码无误后再提交订单！</p>
            </template>
          </van-cell-group>
        </template>


        <template v-if="selected == '3'">
          <!-- 门店配送（送货上门）-->
          <van-cell-group inset class="t-l margin-top-10" v-if="!show_address">
            <van-cell class="padding-10" icon="location-o" is-link :label="`${realname} ${mobile}`" @click="showAddressFun">
              <template #title>
                <div class="f-16 f-bold">{{ realname? address : $i18n.t('base.pleaseSelectAddress')}}</div>
              </template>
            </van-cell>
          </van-cell-group>
          <van-cell-group inset class="t-l margin-top-10" v-if="is_show_store_delivery">
            <!-- 配送说明 -->
            <van-cell title="配送范围" class="f-bold f-15" :border='false'/>
            <p v-html="delivery_note" style="padding: 0 0.75rem;" v-if="delivery_note"></p>
            <!-- 配送范围地图 -->
            <van-cell v-if="!fun.isTextEmpty(delivery_amount)" title="起送价" :value="`${$i18n.t('money')}${delivery_amount}`" :border='false'/>
            <van-cell title="配送范围" is-link value="点击查看" @click="showDeliveryMap" value-class="themeColor" :border='false'/>
          </van-cell-group>
        </template>


        <template v-if="selected == '8'">
          <!-- 自提点（杨朗） -->
          <van-cell-group inset class="t-l margin-top-10" >
            <van-cell class="padding-10" icon="location-o" :is-link="$route.query.tag != 'communityBuy'"
              :label="`${deliverName} ${defaultSelfCarry.deliver_name|| ''} ${defaultSelfCarry.deliver_mobile|| ''}`" @click="replaceZT">
              <template #title>
                <div class="f-16 f-bold" v-if="!fun.isTextEmpty(defaultSelfCarry)">{{ defaultSelfCarry.full_address }}</div>
                <div class="f-16 f-bold" v-if="fun.isTextEmpty(defaultSelfCarry)">
                  <div v-if="!isQuest_ing">所在地区暂无{{ deliverName }}，点击手动切换位置</div>
                  <div v-if="isQuest_ing">正在获取附近{{ deliverName }}信息...</div>
                </div>
              </template>
            </van-cell>

            <template v-if="consigneeName">
              <van-field v-model="distributionUserName" :label="consigneeName" :placeholder="'请输入' + consigneeName" center clearable input-align='right' :border='false'/>
              <van-field v-model="distributionUserMobile" :label="consigneeMobile" :placeholder="'请输入' + consigneeMobile" center clearable input-align='right' :border='false'/>
              <p class="dis_warn f-12" style="margin: 0 10px 10px;">提示：请核对手机号码无误后再提交订单！</p>
            </template>
          </van-cell-group>
        </template>
        <!-- 同城配送 -->
        <template v-if="selected == '11' && cityDelivery != null">
          <van-cell-group inset class="t-l margin-top-10" >
            <van-cell title="配送范围" @click="showDeliveryMap" v-if="cityDelivery.distance_type == 1" value="查看" :border='false' is-link icon="logistics"/>
            <van-cell title="可送达区域" @click="serviceRegionShow = true" v-if="cityDelivery.distance_type == 2" value="查看" :border='false' is-link icon="logistics"/>
            <van-cell title="送达社区" @click="selectCommunityShow = true" v-if="cityDelivery.distance_type == 3"
            :value="cityDelivery_community.name ? cityDelivery_community.name : '请选择'" :border='false' is-link icon="logistics"/>
          </van-cell-group>

          <van-cell-group inset class="t-l margin-top-10" v-if="!show_address">
            <van-cell class="padding-10" icon="location-o" is-link :label="`${realname} ${mobile}`" @click="showAddressFun">
              <template #title>
                <div class="f-16 f-bold">{{ realname? address : $i18n.t('base.pleaseSelectAddress')}}</div>
              </template>
            </van-cell>

            <van-cell title="配送时间" is-link @click="openCityDeliveryDay" v-if="cityDelivery.future_state == 1" icon="underway-o">
              <template #default>
                <div v-if="cityDelivery_deliveryTime.day" style="line-height: 1rem;">
                  {{ cityDelivery_deliveryTime.day }} <br>{{ cityDelivery_deliveryTime.start_time_str }} - {{ cityDelivery_deliveryTime.end_time_str }}
                </div>
                <div v-else>请选择</div>
              </template>
            </van-cell>
          </van-cell-group>
        </template>
        <template v-if="selected == '12'">
          <!-- 门店自提点（门店自己创建的自提点，可更换）  -->
          <van-cell-group inset class="t-l margin-top-10" >
            <van-cell class="padding-10" icon="location-o" :is-link="$route.query.tag != 'communityBuy'"
              :label="`${o2odeliverName} ${o2oSelfCarry.deliver_name || ''} ${o2oSelfCarry.deliver_mobile|| ''}`" @click.stop="replaceZT">
              <template #title>
                <div class="f-16 f-bold" v-if="!fun.isTextEmpty(o2oSelfCarry) && o2oSelfCarry.id">{{ o2oSelfCarry.full_address }}</div>
                <div class="f-15 f-bold" v-else>
                  <div v-if="!isQuest_ing">所在地区暂无{{ o2odeliverName }}，<em class="themeColor">点击手动切换位置</em></div>
                  <div v-if="isQuest_ing">正在获取附近{{ o2odeliverName }}信息...</div>
                </div>
              </template>
            </van-cell>

            <van-field v-model="distributionUserName" label="提货人姓名" placeholder="请输入提货人姓名" center clearable input-align='right' :border='false'/>
            <van-field v-model="distributionUserMobile" label="提货人手机" placeholder="请输入提货人手机" center clearable input-align='right' :border='false'/>
            <p class="dis_warn f-12" style="margin: 0 10px 10px;">友情提示：请核对手机号码无误后再提交订单！</p>
          </van-cell-group>
        </template>

        <template v-if="selected == '15'" >
          <van-cell-group inset class="t-l margin-top-10" >
            <van-cell class="padding-10" icon="location-o" v-if="order_data && order_data[0] && order_data[0].order_address"
              :label="`${fun.getCustomTextLang('package_delivery.preorder_store_area','自提点')} ${order_data[0].order_address.realname} ${order_data[0].order_address.mobile}`">
              <template #title>
                <div class="f-16 f-bold">{{ order_data[0].order_address.address }}</div>
              </template>
            </van-cell>

            <van-field v-model="distributionUserName" :label="fun.getCustomTextLang('package_delivery.preorder_buyer_name','提货人姓名')"
            :placeholder="'请输入'+ fun.getCustomTextLang('package_delivery.preorder_buyer_name','提货人姓名')" clearable :border='false'/>
            <van-field v-model="distributionUserMobile" :label="fun.getCustomTextLang('package_delivery.preorder_buyer_mobile','提货人手机')"
            :placeholder="'请输入' + fun.getCustomTextLang('package_delivery.preorder_buyer_mobile','提货人手机')" clearable :border='false'/>
            <p class="dis_warn f-12" style="margin: 0 10px 10px;">友情提示：请核对手机号码无误后再提交订单！</p>
          </van-cell-group>
        </template>

      </div>
      <!--配送方式填写end-->
    </div>

    <!-- 绿界物流 -->
    <van-cell-group inset class="t-l margin-top-10" v-if="selected == 16">
      <van-field v-model="extra_info.sleectEcp" :error="!extra_info.sleectEcp" @click.stop="getEcpList" required readonly
      is-link label="物流类型" placeholder="请选择收件人物流类型" />
      <van-field v-if="extra_info.ecp_code == 'POST' || extra_info.ecp_code == 'TCAT'" v-model="extra_info.ecp_number"
      :error="!extra_info.ecp_number" required label="邮递区号" placeholder="请填写收件人邮递区号" />
      <van-field v-else v-model="extra_info.ecp_number" :error="!extra_info.ecp_number" required label="门市代号" placeholder="请填写收件人门市代号"/>
    </van-cell-group>
    <van-popup v-model="extra_info.ecpLogPop" position="bottom" round :style="{ minHeight: '30%' }" :close-on-click-overlay="false">
      <van-nav-bar title="物流类型" right-text="确认" @click-right="onChangeEcp"/>
      <van-radio-group v-model="extra_info.ecp_code" class="t-l">
          <van-cell-group>
            <van-cell :title="item.name" v-for="item in extra_info.ecpList" :key="item.code" clickable @click="selectEcpItem(item)">
              <template #right-icon>
                <van-radio :name="item.code" />
              </template>
            </van-cell>
          </van-cell-group>
      </van-radio-group>
    </van-popup>
    <!-- 绿界物流 end -->
    <!--配送方式填写end-->

    <!-- 分时预约  -->
    <van-cell-group inset class="t-l margin-top-10" v-if="root_tag == 'timeAppoint'">
      <van-field v-model="reserve_order.customer_name" label="联系人" placeholder="请填写联系人" :border='false'/>
      <van-field v-model="reserve_order.customer_tel" label="联系电话" placeholder="请填写联系电话" />
      <van-field v-model="$route.query.reserveDataName" :label="appointmentLang.reserve_obj" :readonly="true" :border='false'/>
      <van-field v-model="$route.query.reserveDate" label="预约时间" :readonly="true" :border='false'/>
    </van-cell-group>

    <van-cell-group inset class="t-l margin-top-10" v-if="show_recharge_mobile">
      <!-- 话费慢充 -->
      <template v-if="!phone_bill_pro_goods">
        <van-field v-model="recharge_mobile" label="充值号码" type="tel" placeholder="请输入充值手机号码" clearable :border='false'/>
        <p v-html="recharge_tips" style="padding: 0 0.75rem;" v-if="recharge_tips"></p>
      </template>
      <van-cell title="充值号码" :value="recharge_mobile" v-if="phone_bill_pro_goods" value-class="themeColor" :border='false'/>
    </van-cell-group>

    <!-- 广电 -->
    <broadnetCard v-if="broadnet_card" ref="broadnetCardChild"></broadnetCard>
    <!-- 充值电费 -->
    <van-cell-group inset class="t-l margin-top-10" v-if="electricity">
      <van-cell title="充值户号" :value="eleUser.account_number" value-class="themeColor" :border='false'/>
    </van-cell-group>

    <!-- 油卡充值 -->
    <van-cell-group inset class="t-l margin-top-10" v-if="oil_mobile && oil_account">
      <van-cell title="充值的油卡号" :value="oil_account" value-class="themeColor" :border='false'/>
      <van-cell title="充值的手机号" :value="oil_mobile" value-class="themeColor" :border='false'/>
    </van-cell-group>

    <van-cell-group inset class="t-l margin-top-10" v-if="camilo_resources_coupon_type == 1">
      <!-- 直冲商品 -->
      <van-field v-model="recharge_number" label="充值账号" placeholder="请输入您的充值账号" clearable :border='false'/>
    </van-cell-group>

    <template v-if="this.$route.query.live_install_order_replace_uid">
      <van-cell-group inset class="t-l margin-top-10">
        <van-field v-model="this.$route.query.live_install_order_replace_uid" label="会员ID" readonly error-message="使用该会员优惠抵扣下单"/>
      </van-cell-group>
    </template>

    <template v-if="deliveryTimeParams && deliveryTimeParams.status == 1">
      <!-- 交易设置-收货地址管理-关闭地址是否需要区域  -->
      <van-form ref="deliveryTimeFormValidate" inset class="t-l" style="margin: 10px 10px 0;border-radius: 8px;overflow: hidden;">
        <van-field
          :rules="[{ required: true }]"
          readonly
          required
          clickable
          name="delivery_day"
          :value="shop_delivery_day"
          label="配送日期"
          placeholder="选择配送日期"
          @click="shop_delivery_dayPicker = true"
        />
        <van-field
          :rules="[{ required: true }]"
          readonly
          required
          clickable
          name="delivery_time"
          :value="shop_delivery_time"
          label="配送时间"
          placeholder="选择配送时间"
          @click="shop_delivery_timePicker = true"
        />
      </van-form>
      <van-popup v-model="shop_delivery_dayPicker" position="bottom">
        <van-datetime-picker type="date" title="选择年月日" @confirm="onConfirmShopDeliveryDay" @cancel="shop_delivery_dayPicker = false" :formatter="formatter" :min-date="minDate" />
      </van-popup>
      <van-popup v-model="shop_delivery_timePicker" position="bottom">
        <van-picker title="预约时间段" show-toolbar :columns="deliveryTimeParamsTime" @confirm="onConfirmShopDeliveryTime"
          @cancel="shop_delivery_timePicker = false" :default-index="deliveryTimeParamsTime.length == 24?9:0"/>
      </van-popup>
    </template>

    <!-- 联联周边游填写用户信息 -->
    <template v-if="root_tag == 'tourAround'">
      <van-cell-group inset class="t-l margin-top-10">
        <van-field v-model="customerName" label="姓名" placeholder="请填写姓名" required clearable :border='false'/>
        <van-field v-model="customerPhoneNumber" label="手机号码" placeholder="默认为账号绑定手机号" required clearable :border='false'/>
        <van-field v-model="idCard" label="身份证号" placeholder="请填写身份证号" :required="orderShowIdCard?true:false" clearable :border='false'/>
        <van-cell title="使用时间" :value="travelAroundTime || '请选择'" v-if="orderShowDate == 1" :border="true" is-link @click="showTravel = true" />
        <van-field v-model="memo" label="备注" placeholder="请填写备注" type="textarea" rows="2" />
      </van-cell-group>

      <van-popup v-model="showTravel" @close="deliveryCancel('showTravel')" position="bottom" data-name="showTravel">
        <van-datetime-picker
          title="选择使用日期"
          type="datetime"
          :formatter="formatter"
          :min-date="travelMinDate"
          v-model="travelTime"
          @cancel="deliveryCancel('showTravel')"
          @confirm="travelConfirm"
        />
      </van-popup>
    </template>

    <!--蛋糕叔叔的信息 -->
    <template v-if="root_tag == 'cake'">
      <van-cell-group inset class="t-l margin-top-10">
        <van-field name="cakeShipType" label="配送方式" :is-link="!realname && !shopId" :border="false" input-align="right">
          <template #input>
            <van-radio-group v-model="cakeShipType" v-if="cakeDeliveryArr.length > 0" direction="horizontal">
              <van-radio :name="item.dispatch_type_id" checked-color="var(--themeBaseColor)"  icon-size=".875rem" style="display: flex;"
              @click="deliveryClick(item.dispatch_type_id,index)" v-for="(item,index) in cakeDeliveryArr" :key="index">{{item.name}}</van-radio>
            </van-radio-group>
            <div v-else-if="!realname && !shopId">请先选择地址</div>
            <div v-else class="themeColor">该地址暂不可配送</div>
          </template>
        </van-field>
        <van-field label="订货人手机号" v-model="cakeMoblie" placeholder="请输入订货人手机号" use-button-slot :border="false">
          <div slot="button" class="flex-a-c">
            <span class="f-14 margin-right-6">同收货人</span>
            <van-checkbox v-model="cakeChecked" @change="onCakeChange" icon-size="0.9375rem" checked-color="#f15353"></van-checkbox>
          </div>
        </van-field>
        <van-cell icon="location-o" v-if="cakeShipType == 'shop'" is-link :label="`${shopId?'门店 ' + shopName :''}`" @click="gotochangeCake">
          <template #title>
            <div class="f-16 f-bold">{{ shopId? shopDetail : '请点击选择自提门店'}}</div>
          </template>
        </van-cell>
        <template v-if="cakeShipType === 'delivery' || cakeShipType === 'shop'">
          <van-cell title="配送日期" :value="cakeShipDate || '请选择'" :border="false" data-name="showCake" is-link @click="showCakePopup" />
          <van-cell title="配送时间" :value="shipTimeText || '请选择'" :border="false" is-link data-name="cakeTimeShow"  @click="cakeTimePopup" />
        </template>
      </van-cell-group>

      <van-popup v-model="showCake" @close="deliveryCancel('showCake')" position="bottom" data-name="showCake" round>
        <van-datetime-picker
          title="选择配送日期"
          type="date"
          :formatter="formatter"
          :min-date="cakeStartTime"
          :max-date="cakeEndTime"
          v-model="cakeCurrentTime"
          @cancel="deliveryCancel('showCake')"
          @confirm="deliveryConfirm"
        />
      </van-popup>

      <van-popup v-model="cakeTimeShow" @close="deliveryCancel('cakeTimeShow')" class="pop-base-class" position="bottom" round style="background-color: #F5F5F5;" closeable>
        <div class="pop-base-title">选择配送日期</div>
        <div class="pop-base-content">
          <div class="cake-main" v-if="takeDates">
            <block v-for="(item, index) in takeDates" :key="index">
              <div class="flex-j-sb flex-a-c margin-top-10">
                <div>{{ item.text }}</div>
                <van-checkbox v-model="item.checked" @click="cakeTimeChange(item.text, index)" icon-size="28rpx" checked-color="var(--themeBaseColor)"></van-checkbox>
              </div>
            </block>
          </div>
          <van-empty description="暂无数据" v-else />
        </div>
        <div class="pop-base-bottom flex" @click="cakeTimeConfirm">
          <van-button round type="danger" block color="var(--themeBaseColor)" style="height: 40px;">确定</van-button>
        </div>
      </van-popup>

      <van-popup v-model="cakeStoreShow" @close="deliveryCancel('cakeStoreShow')" class="pop-base-class" position="bottom" round style="background-color: #F5F5F5;" closeable>
        <div class="pop-base-title">选择门店</div>
        <div class="pop-base-content t-l">
          <van-cell-group v-if="storeList.length > 0">
            <van-cell v-for="(item, index) in storeList" :key="index" :title="item.shop_name"
            :label="`${item.distance && item.distance.toFixed(2)}km|${item.address}`" @click.stop="showDetail(item)"/>
          </van-cell-group>
          <van-empty description="暂无数据" v-else />
        </div>
        <div class="pop-base-bottom flex" @click="deliveryCancel('cakeStoreShow')">
          <van-button round type="danger" block color="var(--themeBaseColor)" style="height: 40px;">关闭</van-button>
        </div>
      </van-popup>
    </template>

    <!-- 兑换码 -->
    <van-cell-group inset class="t-l margin-top-10" v-if="$route.query.name&&$route.query.current_code">
      <van-cell title="兑换码" :value="$route.query.name" value-class="themeColor" />
      <van-cell title="序列号" :value="$route.query.current_code" value-class="themeColor" :border='false'/>
    </van-cell-group>

    <!--商品表单  用于跨境商品报税使用 -->
    <template v-if="showMyinfo">
      <van-cell-group inset class="t-l margin-top-10" >
        <van-cell title="姓名" :value="myRealname||'--'" value-class="themeColor" />
        <van-cell title="身份证号" :value="myIdcard||'--'" value-class="themeColor"/>
        <van-cell title="修改个人信息" value="点击修改"  is-link :border='false' @click.native="showFrom = true"/>
        <p class="dis_warn f-12" style="margin: 0 10px 10px;">请核查个人信息！</p>
      </van-cell-group>

      <yz-myinfo v-model="showFrom" @confirm="confirmFrom"></yz-myinfo>
      <!--商品表单end-->
    </template>
    <!-- 上传相册模块（备注：相册模块适用于商城商品和供应商商品）-->
    <van-cell-group inset class="t-l margin-top-10" v-if="isPhoto">
      <van-cell title="上传图片" :label="`选择不低于${min_count}张，不高于${max_count}张)`"/>
      <yz_uploader ref="yzUploader" v-model="fileList1" :max_count="max_count" :min_count="min_count"></yz_uploader>
      <p v-if="storeNo_photo" class="dis_warn f-12" style="margin: 0 10px 10px;">如需上传相册，请选择单个商品下单结算</p>
    </van-cell-group>
    <!-- 上传相册模块 end-->
    <van-cell-group inset class="t-l margin-top-10" v-if="storeTable && storeTable.table_name">
      <van-cell title="餐桌号" :value="storeTable.table_name" value-class="themeColor" />
    </van-cell-group>

    <p class="dis_warn margin-10 margin-top-8 t-l" v-if="isRent && !(rent_deposit_free == 0 && rent_free == 0)">
      <!--租赁信息-->
      <i class="iconfont icon-tishi" style="color: #f15353;"></i> 您还可以免费租 <em class="f-bold">{{ rent_free }}</em> 件商品！
    </p>

    <div class="t-l">
      <div v-for="(item, index) in order_data" :key="index">
        <div class="box-base">
          <div class="f-bold f-15">{{ item.shop_name }}</div>
          <div class="f-13 margin-top-8" v-if="cityDelivery && cityDelivery.min_amount * 1 > item.order_goods_price * 1 && selected == '11'">
            还差<span style="color: var(--themeBaseColor)">￥{{ (cityDelivery.min_amount * 1 - item.order_goods_price * 1).toFixed(2) }}</span
            >满足起送<span style="color: #AAAAB3;">（起送价￥{{ cityDelivery.min_amount }}）</span>
          </div>
          <div class="detail_good">
            <div class="goods margin-top-8" v-for="(g, i) in item.order_goods" :key="i">
              <div class="goods-top">
                <div class="img">
                  <img :src="g.thumb" referrerPolicy="no-referrer"/>
                </div>
                <!-- 普通商品显示 -->
                <div class="warp flex-column flex-j-sb f-12">
                  <div class=" f-bold line-clamp-2" :class="[root_tag != 'oil_order'?'f-14':'f-20']">{{ g.title | escapeTitle }}</div>
                  <div class="f-13 margin-top-4" style="color: #9898A1;">{{ g.goods_option_title }}</div>
                  <div style="flex: 1;"></div>

                  <template v-if="isRent && root_tag != 'oil_order'">
                    <!-- 租赁商品 -->
                    <div v-if="root_tag != 'yzlease' && !isRentSetting">押金 {{ $i18n.t("money") }}{{ g.has_one_lease_goods.goods_deposit }}</div>
                    <div class="margin-top-4 f-12 flex-j-sb">
                      <div>租金 {{ $i18n.t("money") }}{{ g.price }}</div>
                      <div v-if="root_tag != 'yzlease' && !isRentSetting">{{ $i18n.t("money") }} {{ g.order_lease_goods[0].lease_price }} {{ $i18n.t("元") }}/天</div>
                    </div>
                    <div class="margin-top-4 f-14 f-bold flex-j-sb" v-if="!isRentSetting">
                      <p v-if="!goodsInfo.noShowPrice" class="themeColor">
                        <i class="iconfont icon-rent" v-if="!(rent_deposit_free == 0 && rent_free == 0)"></i>
                        {{ $i18n.t("money") }}{{ root_tag != 'yzlease'?g.order_lease_goods[0].lease_price / g.total.toFixed(2):g.yz_supply_lease_goods.lease_price / g.yz_supply_lease_goods.total.toFixed(2) }}{{ $i18n.t("元") }}/天
                      </p>
                      <p>×{{ g.total }}</p>
                    </div>
                  </template>

                  <template v-if="!isRent && root_tag != 'oil_order'">
                    <div class="f-13 themeColor" v-if="reserveDate">预约日期：{{ reserveDate }}</div>
                    <div class="margin-top-4 f-14 f-bold flex-j-sb">
                      <p v-if="!goodsInfo.noShowPrice">
                        <span v-if="item.plugin_id == 108" class="dis_warn" style="padding: 4px;"><!--判断定金活动-->定金</span>{{ $i18n.t("money") }}{{ (g.price / g.total).toFixed(2) }}
                      </p>
                      <p>×{{ g.total }}</p>
                    </div>
                    <div class="themeColor" v-if="g.show_time_word">{{g.show_time_word}}</div>
                    <div class="flex margin-top-2" style="color: #F38D54;" >
                      <div v-if="vip_show && !goodsInfo.noShowPrice" style="margin-right: 8px;">
                        会员价: {{ $i18n.t("money") }}{{ vipPriceMethod(g.vip_price, g.total) }}
                      </div>
                      <div class="dis_warn f-11" v-if="g.points" style="padding: 0 4px;border-radius: 4px;font-weight: 400;">
                        送{{ g.points }}{{ integral }}
                      </div>
                    </div>
                    <div class="margin-top-4" v-if="$route.query.runningTime">时长: {{ $route.query.runningTime }}秒</div>
                    <div class="margin-top-4" v-if="coffee_machine_open_state && goodFittle_coffee(g.goods_id,coffee_goods_ids)">有效期：{{coffeeDay}}天</div>
                    <div class="margin-top-4" v-if="g.goods_contribution && Number(g.goods_contribution.amount) > 0">预计{{g.goods_contribution.plugin_name}}数：{{g.goods_contribution.amount}}</div>
                    <div class="cloud_service_notes" v-if="g.cloud_shop">
                      <div class="notes" @click="tap_noteShow(note)" v-for="note in g.cloud_shop.service_notes" :key="note.id">
                        {{ note.name }} <i class="iconfont icon-advertise-next"></i>
                      </div>
                    </div>
                  </template>
                </div>
                <!-- 普通商品显示结束 -->
              </div>

              <div v-if="g.diy_form" class="diyFormDiv flex-j-sb flex-a-c margin-top-8"  @click="getGoodDFData(g.pre_id, g.diy_form.form_id, !g.diy_form.diyform_data_id?null:g.diy_form.diyform_data_id)">
                  <div>
                    <i class="iconfont icon-icon_dingdan_1"></i>
                    <span class="margin-left-4">表单</span>
                  </div>
                  <div>
                    {{!g.diy_form.diyform_data_id?'去填写':'已填写'}}
                    <i class='iconfont icon-icon_more11'></i>
                  </div>
              </div>
            </div>
          </div>

          <van-cell-group class="cell-group-padding margin-top-8" :border="false">
            <van-cell title="会员权益" :border="false" v-if="(isRent && root_tag != 'yzlease')&&!(rent_deposit_free == 0 && rent_free == 0)">
              <template #right-icon>
                <van-switch v-model="isOpenRight" :active-color="'var(--themeBaseColor)'" inactive-color="#fff" size="23" @change="rentSelect" />
              </template>
            </van-cell>
            <template v-if="root_tag != 'oil_order'">
              <van-cell :title="isRent ? $i18n.t('base.rent') : $i18n.t('base.productAmount')" :value="`${$i18n.t('money')}${item.order_goods_price }`" :border="false"/>
              <van-cell :title="$i18n.t('base.memberPrice')" :value="`${$i18n.t('money')}${item.vip_order_goods_price}`" :border="false" v-if="vip_show"/>
              <van-cell :value="`${$i18n.t('money')}${item.initial_freight}`" :border="false">
                <template #title>
                  <div v-if="selected == 11">
                    <span class="margin-right-6">{{$i18n.t('base.deliveryFee')}}</span>
                    <van-icon name="question-o" @click="costSpecShow = true" v-if="cityDelivery && cityDelivery.price_setting && cityDelivery.price_setting.show_state == 1"/>
                  </div>
                  <div v-else>
                    <span class="margin-right-6">{{$i18n.t('base.shippingCost')}}</span>
                    <van-icon name="question-o" @click="ferightExplainPop = true" v-if="freightExplain && freightExplain.is_freight_explain == 1"/>
                  </div>
                </template>
              </van-cell>
            </template>
            <template v-if="root_tag == 'oil_order'">
              <van-cell title="车牌号" :value="`${$route.query.plate_num}`" :border="false"/>
              <van-cell title="订单金额" :value="`${$route.query.amt}`" :border="false"/>
              <van-cell title="加油升数" :value="`${$route.query.litre}`" :border="false"/>
            </template>
            <van-cell :title="it.name" :value="`${$i18n.t('money')}${it.amount}`" v-for="(it, i) in item.order_fees" :key="i" :border="false"/>
            <van-cell title="预约扣除" :value="`${reserve_deduction}${integral}`" :border="false" v-if="reserve_deduction"/>
            <van-cell title="预约扣除" :value="`${reserve_deduction_love}${love_name}`" :border="false" v-if="reserve_deduction_love"/>

            <template v-if="item.order_deductions && root_tag !== 'tourAround'">
              <van-cell :border="false" v-for="(d, i) in item.order_deductions" :key="i">
                <template #title>
                  可用{{ parseFloat(d.coin).toFixed(2) }}{{ d.name || integral }} {{ deduction_lang ? deduction_lang : "抵扣" }}{{ d.amount }}{{ $i18n.t("元") }}
                </template>
                <template #right-icon>
                  <van-switch v-model="d.checked" :active-color="'var(--themeBaseColor)'" inactive-color="#fff" size="23" @change="discountHandle(item, d, 'discount')" v-show="good_clicktag == 0"/>
                  <van-loading v-show="good_clicktag != 0"/>
                </template>
                <template #label>
                  <div style="width: 100%;background: #f3f3f3;border-radius: 4px;padding: 0 4px;" v-if="d.deduction_detail && d.checked">
                    <div class="flex">
                      <div :class="{'f-grow-2': deduction.key === 'tag_name'}" style="flex: 1;text-align: left;overflow: hidden;" v-for="deduction in d.deduction_detail.nav" :key="deduction.key">
                        <div class="f-11 f-bold">{{deduction.name}}</div>
                        <div class="flex f-10" style="flex-direction: column;">
                          <div class="line-clamp-1" v-for="(de_data,de_data_i) in d.deduction_detail.data" :key="de_data_i">{{de_data[deduction.key]}}</div>
                        </div>
                      </div>
                    </div>
                  </div>
                </template>
              </van-cell>
            </template>

            <template v-if="item.order_coin_exchanges && root_tag !== 'tourAround'">
              <template v-for="(d, i) in item.order_coin_exchanges">
                <van-cell :border="false" v-if="!d.no_show" :key="i">
                  <template #title>
                    <template v-if="!d.show_style">
                      {{ parseFloat(d.coin).toFixed(2) }}{{ d.name || integral }}
                      <span>{{ deduction_lang ? deduction_lang : "抵扣" }}{{ d.amount }}{{ $i18n.t("元") }}</span>
                    </template>
                    <template v-else> {{ d.name || integral }}{{ deduction_lang ? deduction_lang : "抵扣" }} </template>
                  </template>
                  <template #right-icon>
                    <template v-if="d.show_style"> -{{ parseFloat(d.coin).toFixed(2) }} </template>
                  </template>
                </van-cell>
              </template>
            </template>

            <van-field v-if="root_tag != 'oil_order'" rows="1" autosize v-model="note[item.pre_id]" :label="$i18n.t('base.buyerNote')" placeholder="如需备注信息请输入"
            type="textarea" @blur="noteHandle($event, item, note[item.pre_id])" input-align="right"/>
          </van-cell-group>
        </div>

        <!-- 服务费、运费说明 start @change="discountHandle(item, fees, 'serviceFee')"-->
        <van-checkbox-group v-model="service_fee[item.pre_id]" @change="discountHandle(item, fees, 'serviceFee')" v-if="item.order_service_fees.length"
          class="box-base  margin-top-8 t-l van-cell-group" style="padding: 2px 0;">
          <div v-for="(fees, i) in item.order_service_fees" :key="i.code" class="shipping_ins">
            <van-divider v-if="i != 0"/>
            <van-cell :title="`是否需要${fees.name}`" :border="false" >
              <template #right-icon>
                <van-switch v-model="fees.checked" inactive-color="#dcdee0" :active-color="'var(--themeBaseColor)'" size="23px" @change="switchChange(item, fees, 'serviceFee')"> </van-switch>
              </template>
            </van-cell>
            <van-cell :title="fees.name" :value="`${$i18n.t('money')}${fees.amount}`" :border="false" v-show="fees.show"/>
            <template v-if="fees.code == 'liveInstall' && fees.show">
              <van-cell :border="false" center >
                <template #title>预约{{ (plugin_setting.live_install && plugin_setting.live_install.custom_name) || "安装" }}时间</template>
                <template #right-icon>
                  <div class="flex-a-c" @click.stop="showInstallPop = true">
                    {{ installDate ? installDate.Format("yyyy-MM-dd hh:mm:ss") : "请选择" }}<i class="fa fa-angle-right f-18 margin-left-6"></i>
                  </div>
                </template>
              </van-cell>
              <van-cell title="地理位置" :border="false" center>
                <template #right-icon>
                  <div @click.stop="showLocationPop" class="flex-a-c">
                    <div class="t-r f-12" style="line-height: 14px;flex: 1;max-width: 10rem;">{{ location.address ? location.address : "定位中..." }}</div>
                    <i class="iconfont icon-dingwei" style="color: #f86e6e; padding-right: 0.25rem;"></i>
                  </div>
                </template>
              </van-cell>
              <van-field rows="1" autosize v-model="install_comment" :border="false" input-align="right"
                :label="`${plugin_setting.live_install && plugin_setting.live_install.custom_name ||'安装'}留言`" placeholder="如需备注信息请输入" type="textarea"/>
            </template>
          </div>
        </van-checkbox-group>
        <!-- 服务费、运费说明 end -->
        <!-- 供应商商品是否含税 start -->
        <van-cell-group class="box-base cell-group-padding margin-top-8" :border="false" v-if="item.order_tax_fees.length">
          <van-cell :title="kfee.show_name||'是否'" :border="false" center v-for="kfee in item.order_tax_fees" :key="kfee">
            <template #right-icon>
              <van-radio-group v-model="kfee.checked" direction="horizontal" @change="kfeeChange($event, item, kfee)">
                <van-radio :name="false" icon-size="20px">是</van-radio>
                <van-radio :name="true" icon-size="20px">否</van-radio>
              </van-radio-group>
            </template>
          </van-cell>
        </van-cell-group>
        <!-- 供应商商品是否含税 end -->
      </div>
      <div class="box-base margin-top-8 rent-time" v-if="isRent && isRightChoose">
        <div>租期</div>
        <div class="week">
          <van-button type="default" v-for="(item, index) in rentTime" :key="index" @click.native="rentTimeChoose(item, index)" :class="{ active: index == currentIndex }">
            {{ item.term_name || '默认租期' }}<br /><span class="text themeColor">优惠{{ item.term_discount }}% </span>
          </van-button>
          <van-button type="default" @click.native="rentSelfChoose"><i class="iconfont icon-icon_add"></i><br />自定义</van-button>
        </div>
      </div>
    </div>
    <!--商品订单结束-->

    <agency-saleman ref="agencySaleman" v-if="goodsInfo.is_salesman_dividend == 1" :mid="goodsInfo.self_member_id"><!--创达通-销售员分红 #85033--></agency-saleman>

    <van-cell-group class="box-base  margin-top-8 t-l" :border="false" style="padding: 2px 0;" v-if="coupons_new.length||coupon_size||distribution_couponData.length">
      <van-cell :value="`${coupons_new.length}张可用`" is-link @click="showCoupon_new" value-class="themeColor" v-if="coupons_new.length > 0">
        <template #title>
          <span class="custom-title">新优惠券</span>
          <van-tag color="var(--themeBaseColor)" plain v-show="use_coupon_size_new" class="margin-left-4">已选择{{ use_coupon_size_new }}张</van-tag>
        </template>
      </van-cell>
      <van-cell :value="`${coupon_size}张可用`" is-link @click="showCoupon" value-class="themeColor" v-if="(isShowCoupon && coupon_size > 0) && root_tag !== 'tourAround' && root_tag != 'yzlease'">
        <template #title>
          <span class="custom-title">优惠券</span>
          <van-tag color="var(--themeBaseColor)" plain v-show="use_coupon_size" class="margin-left-4">已选择{{ use_coupon_size }}张</van-tag>
        </template>
      </van-cell>
      <van-cell :value="`${distribution_couponData.length}张可用`" is-link @click="showDistribution_coupon" value-class="themeColor" v-if="root_tag == 'distribution_coupon' && distribution_couponData.length > 0">
        <template #title>
          <span class="custom-title">配销券</span>
          <van-tag color="var(--themeBaseColor)" plain v-show="distribution_coupon_ids.length" class="margin-left-4">已选择{{ distribution_coupon_ids.length }}张</van-tag>
        </template>
      </van-cell>
    </van-cell-group>

    <!-- 凑单减邮费 -->
    <addGoodsModule v-if="recommend_goods && recommend_goods.length > 0" :datas="recommend_goods"></addGoodsModule>

    <!--应用市场下单 -->
    <van-cell-group v-if="show_domain" class="box-base cell-group-padding margin-top-8 t-l" :border="false" style="padding: 0.375rem 0.75rem;">
      <van-cell @click="toSite" value-class="themeColor" title="我的站点" :value="shop_domain ? shop_domain : '新增/绑定站点'" :is-link="!shop_domain"></van-cell>
    </van-cell-group>

    <!-- 发票
      <order_invoice v-if="isShowInvoice" :invoiceData="invoiceData" @subInvoice="subInvoice"></order_invoice>
    发票end -->
    <!-- 发票插件 -->
    <invoice-pop ref="invoicePop" @openAddList="invoiceShowAddressFun" @confirm="subInvoice" :addressData="addressData"></invoice-pop>

    <van-cell-group class="box-base cell-group-padding margin-top-8 t-l" style="padding: 0.375rem 0.75rem;">
      <van-cell v-for="item in total_items" :key="item.code" :title="item.name"
        :value="`${item.code == 'total_deduction_price'?'-':''}${$i18n.t('money')}${item.amount}`" value-class="themeColor" :border="false"/>
      <van-cell :title="item.name" v-for="item in discount_amount_items" :key="item.code"
        v-show="!item.no_show" :border="false">
        <template #right-icon>
          <div class="themeColor flex">
            - <div v-if="item.code !== 'pointCoinExchanges'">{{ $i18n.t("money") }}</div>{{ item.amount }}
            <template v-if="item.detail"><br>{{item.detail}}</template>
          </div>
        </template>
      </van-cell>
      <van-cell v-for="(item, i) in service_fee_items" :key="i" :title="item.name"
        :value="`${$i18n.t('money')}${item.amount}`" value-class="themeColor" :border="false"/>
      <van-cell v-for="(item, i) in tax_fee_items" :key="i" :title="item.name"
        :value="`${$i18n.t('money')}${item.amount}`" value-class="themeColor" :border="false"/>
      <van-cell v-if="isRent && root_tag != 'yzlease'" title="押金（可退还）" :value="`${$i18n.t('money')}${goodsInfo.total_deposit||''}`" value-class="themeColor" :border="false"/>
    </van-cell-group>

    <template v-if="local_life.need_mobile">
      <!-- 本地生活 -->
      <van-cell-group inset class="t-l margin-top-10">
        <van-field v-model="local_life_mobile" label="手机号" placeholder="请输入手机号"/>
      </van-cell-group>
    </template>

    <div style="height: 8.5rem;"></div>

    <div class="detail_pay">
      <a :href="storeSearchBtn.web_url" v-if="storeSearchBtn.is_open_but && storeSearchBtn.but_title" class="dis_warn flex-j-sb" style="border-radius: 0;">
        <!-- 门店 href需为开头需要带协议 -->
        <div>{{ storeSearchBtn.but_title || '点击跳转'}}</div>
        <i class="iconfont icon-icon_more11"></i>
      </a>

      <div style="padding: 10px 10px 6px;" v-if="isRent || AgreementPay">
        <van-checkbox v-model="agreement" v-if="isRent" checked-color="var(--themeBaseColor)" label-disabled :style="{'padding-bottom': AgreementPay?'6px':''}">
          我已认真阅读并同意该<span @click.stop="showAgreement" class="themeColor">《租赁协议》</span>
        </van-checkbox>
        <van-checkbox v-else-if="AgreementPay" v-model="agreementPay" checked-color="var(--themeBaseColor)" label-disabled >
          <div @click.stop="showPay" class="themeColor">《{{ $i18n.t('base.paymentAgreement') }}》</div>
        </van-checkbox>
      </div>

      <div class="flex-j-sb flex-a-c" style="padding: 0.375rem 0.75rem 0.5rem;">
        <div class="flex-column">
          <div class="flex-a-c f-13 ">{{ $i18n.t('base.total') }} <div class="themeColor f-bold f-18 flex-a-c margin-left-4"> <div class="f-13">{{ $i18n.t("money") }}</div> {{ price }}</div></div>
          <div class="f-11" v-if="isRent && root_tag != 'yzlease'" style="color: #666666;">（押金{{ $i18n.t("money") }}{{ goodsInfo.total_deposit }}可退）</div>
        </div>

        <div class="order_delete" :class="{ disabled: yz_subscribe_disabled }" @click="submit">
          {{ $i18n.t('base.submitOrder') }}
          <!-- 订阅信息 -->
          <yzSubscribe v-on:confirm="confirmSub" v-on:error="errorSub" :tagName="'submit_order'" :styleWidth="'150px'"></yzSubscribe>
        </div>
      </div>
    </div>

    <!--自定义表单-->
    <van-popup v-model="dyFormPopup" position="bottom" class="mint-popup-4" :style="{ width: '100%', height: '100%', overflow: 'auto', display: dyFormPopup ? 'flex' : 'none' }">
      <diyfrom
        v-if="dyFormPopup"
        v-on:submitsave="diyFormSave"
        style="height: 100%; overflow: auto;"
        :form_id="goodDYDormID"
        :form_data_id="activeFormDataID"
        modeType="Single"
        :singleStatus="true"
        :isorder="true"
        @closeonGoBackTitle="closeonGoBackTitle"
      ></diyfrom>
    </van-popup>

    <template v-if="freightExplain">
      <van-popup v-model="ferightExplainPop" class="pop-base-class" position="bottom" round style="background-color: #F5F5F5;" closeable>
        <div class="pop-base-title">运费说明</div>
        <div class="pop-base-content t-l">
          <p v-for="(item, key) in freightExplain.freight_explain_content" :key="key">{{ item }}</p>
        </div>
        <div class="pop-base-bottom flex" @click="ferightExplainPop = false">
          <van-button round type="danger" block color="var(--themeBaseColor)" style="height: 40px;">确定</van-button>
        </div>
      </van-popup>
    </template>

    <!-- 配销券 -->
    <van-popup v-model="distribution_couponSpecs" class="pop-base-class" position="bottom" round style="background-color: #F5F5F5;" closeable>
      <div class="pop-base-title">选择配销券</div>
      <div class="pop-base-content">
        <div class="flex-a-c" v-for="(item, index) in distribution_couponData" :key="index" @click.stop="ChangeDistribution(item.id,item.valid)">
          <div class="box-base flex coupon_voucher_main" :class="{ 'disabled-block': !item.valid }"
          style="padding: 0;margin: 0 0 0.625rem;">
            <div class="flex flex-j-c flex-a-c themeColor" style="min-width: 6.875rem;margin: 8px 0;border-right: 1px dashed #D6D6DC;">
              <div class="flex-column ">
                <div class="f-24 f-bold flex-a-c"><div class="f-12">￥</div>{{ item.coupon && item.coupon.price }}</div>
              </div>
            </div>
            <div class="t-l flex-column" style="flex: 1;padding: 10px 8px;">
              <div class="flex">
                <p class="f-14 f-bold line-clamp-2" style="line-height: 15px;flex: 1;">{{ item.coupon && item.coupon.name }}</p>
                <van-checkbox v-show="distribution_coupon_ids.includes(item.id)" value="true" checked-color="var(--themeBaseColor)"></van-checkbox>
              </div>
              <div style="flex: 1;"></div>
              <p v-if="!is_coupon_SELE" class="f-11" style="color: #666666;">有效期：{{ item.coupon.active_start }}至{{ item.coupon.active_end }}</p>
            </div>
          </div>
        </div>
      </div>
      <div class="pop-base-bottom flex" @click="distribution_couponSpecs = false">
        <van-button round type="danger" block color="var(--themeBaseColor)" style="height: 40px;">确认使用</van-button>
      </div>
    </van-popup>

    <!--优惠券-->
    <van-popup v-model="popupCouponSpecs" class="pop-base-class" position="bottom" round style="background-color: #F5F5F5;" closeable>
      <div class="pop-base-title">优惠券</div>
      <div class="pop-base-content">
        <div class="flex-a-c" v-for="(coupon, index) in coupons" :key="index" @click.stop="chooseCoupon(index, coupon.valid)">
          <div class="box-base flex coupon_voucher_main" style="padding: 0;margin: 0 0 0.625rem;" :class="{'disabled-block': !coupon.valid}">
            <div class="flex flex-j-c flex-a-c themeColor" style="min-width: 6.875rem;margin: 8px 0;border-right: 1px dashed #D6D6DC;">
              <div class="flex-column"  v-if="coupon.belongs_to_coupon.coupon_method == 1">
                <p class="f-24 f-bold">
                  {{ coupon.belongs_to_coupon.deduct }}
                </p>
                <p class="f-12">满{{ coupon.belongs_to_coupon.enough }}立减</p>
              </div>
              <div class="flex-column" v-else>
                <p class="f-24 f-bold">{{ coupon.belongs_to_coupon.discount }}折</p>
                <p class="f-12">满{{ coupon.belongs_to_coupon.enough }}立享</p>
              </div>
            </div>
            <div class="t-l flex-column" style="flex: 1;padding: 10px 8px;">
              <div class="flex">
                <p class="f-14 f-bold line-clamp-2" style="line-height: 15px;flex: 1;">{{ coupon.belongs_to_coupon.name }}</p>
                <van-checkbox v-show="good_clicktag == 0" v-model="coupon.checked" :disabled="!coupon.valid" checked-color="var(--themeBaseColor)"
                :name="coupon" @change="selectCoupon($event, coupon)" ref="checkboxes"> </van-checkbox>
              </div>
              <div style="flex: 1;"></div>
              <div class="flex-j-sb flex-a-c" v-if="is_coupon_SELE && coupon.checked && coupons_temp[coupon.coupon_id]">
                <div style="font-size: 12px;padding: 0 4px;height: 18px;line-height: 16px;border-radius: 3px;border: 1px solid #707070;">{{ coupon.has_conpon_id.length }}张</div>
                <div v-if="good_clicktag == 0 && stepper_show == 0" @click.stop>
                  <!-- :max="coupon.valid_num" -->
                  <van-stepper
                    :class="[coupons_temp[coupon.coupon_id].num >= coupon.valid_num ? 'maxDisabled' : '']"
                    :value="coupons_temp[coupon.coupon_id].num"
                    async-change
                    theme="round"
                    button-size="22"
                    integer
                    min="1"
                    :name="coupon"
                    @change="changeCoupon"
                  />
                </div>
                <div v-show="good_clicktag != 0 || stepper_show != 0">
                  <van-loading />
                </div>
              </div>
              <p v-if="!is_coupon_SELE" class="f-11" style="color: #666666;">{{ coupon.time_start }} - {{ coupon.time_end }}</p>
            </div>
          </div>
        </div>
      </div>

      <div class="pop-base-bottom flex" @click="popupCouponSpecs = false">
        <van-button round type="danger" block color="var(--themeBaseColor)" style="height: 40px;">{{ isCueCoupon ? "确定使用" : "确认" }}</van-button>
        <van-button v-if="isCueCoupon && use_coupon_size == 0" round type="default" block class="margin-left-6" style="height: 40px;">不用优惠</van-button>
      </div>
    </van-popup>
    <!--新优惠券-->
    <van-popup v-model="popupCouponSpecs_new" class="pop-base-class" position="bottom" round style="background-color: #F5F5F5;" closeable>
      <div class="pop-base-title">新优惠券</div>
      <div class="pop-base-content">
        <div class="flex-a-c" v-for="(coupon, index) in coupons_new" :key="index" @click.stop="chooseCoupon_new(index, coupon)">
          <div class="box-base flex coupon_voucher_main" style="padding: 0;margin: 0 0 0.625rem;" :class="{'disabled-block': !coupon.valid}">
            <div class="flex flex-j-c flex-a-c themeColor" style="min-width: 6.875rem;margin: 8px 0;border-right: 1px dashed #D6D6DC;">
              <div class="flex-column">
                <p class="f-24 f-bold flex">
                  <span v-if="coupon.coupon.discount_rule_str.is_price">¥</span>
                  {{coupon.coupon.discount_rule_str.discount}}
                  <span v-if="coupon.coupon.discount_rule_str.is_rebate">折</span>
                </p>
                <p class="f-12">{{ coupon.coupon.discount_rule_str.desc }}</p>
              </div>
            </div>
            <div class="t-l flex-column" style="flex: 1;padding: 10px 8px;">
              <div class="flex">
                <p class="f-14 f-bold line-clamp-2" style="line-height: 15px;flex: 1;">{{ coupon.coupon.coupon_name }}</p>
                <van-checkbox v-show="good_clicktag == 0" v-model="coupon.checked" :disabled="!coupon.valid" checked-color="var(--themeBaseColor)"
                :name="coupon" @change="selectCoupon_new($event, coupon)" ref="checkboxes_new"> </van-checkbox>
              </div>
              <div style="flex: 1;"></div>
              <div class="flex-j-sb flex-a-c" v-if="is_coupon_SELE && coupon.checked && coupons_temp[coupon.coupon_id]">
                <div style="font-size: 12px;padding: 0 4px;height: 18px;line-height: 16px;border-radius: 3px;border: 1px solid #707070;">{{ coupon.has_conpon_id.length }}张</div>
                <div v-if="good_clicktag == 0 && stepper_show == 0" @click.stop>
                  <!-- :max="coupon.valid_num" -->
                  <van-stepper
                    :class="[coupons_temp[coupon.coupon_id].num >= coupon.valid_num ? 'maxDisabled' : '']"
                    :value="coupons_temp[coupon.coupon_id].num"
                    async-change
                    theme="round"
                    button-size="22"
                    integer
                    min="1"
                    :name="coupon"
                    @change="changeCoupon"
                  />
                </div>
                <div v-show="good_clicktag != 0 || stepper_show != 0">
                  <van-loading />
                </div>
              </div>
              <p v-if="!is_coupon_SELE" class="f-11" style="color: #666666;">{{ coupon.time_start }} - {{ coupon.time_end }}</p>
            </div>
          </div>
        </div>
      </div>

      <div class="pop-base-bottom flex" @click="popupCouponSpecs_new = false">
        <van-button round type="danger" block color="var(--themeBaseColor)" style="height: 40px;">{{ isCueCoupon ? "确定使用" : "确认" }}</van-button>
        <van-button v-if="isCueCoupon && use_coupon_size == 0" round type="default" block class="margin-left-6" style="height: 40px;">不用优惠</van-button>
      </div>
    </van-popup>

    <!-- 租赁协议 -->
    <template v-if="isRent">
      <van-popup v-model="agreementShow" class="pop-base-class" position="bottom" round style="background-color: #F5F5F5;" closeable>
        <div class="pop-base-title">租赁协议</div>
        <div class="pop-base-content">
          <div class="f-16" v-if="root_tag != 'yzlease'">{{ agreeCon.pact_title }}</div>
          <p v-html="root_tag != 'yzlease'?agreeCon.lease_toy_pact:agreeCon"></p>
        </div>
        <div class="pop-base-bottom flex" @click="agreementShow = false">
          <van-button round type="danger" block color="var(--themeBaseColor)" style="height: 40px;">关闭</van-button>
        </div>
      </van-popup>
      <van-popup v-model="showPop" class="pop-base-class" position="bottom" round style="background-color: #F5F5F5;" closeable>
        <div class="pop-base-title">自定义租期</div>
          <div class="pop-base-content">
            <van-cell-group inset>
              <van-field v-model="popCode" placeholder="请输入租期" />
            </van-cell-group>
          </div>
          <div class="pop-base-bottom flex" @click="activation">
            <van-button round type="danger" block color="var(--themeBaseColor)" style="height: 40px;">确认</van-button>
          </div>
      </van-popup>
    </template>

    <!-- 支付协议 -->
    <template v-if="AgreementPay">
      <van-popup v-model="agreementPayShow" class="pop-base-class" position="bottom" round style="background-color: #F5F5F5;" closeable>
        <div class="pop-base-title">{{$i18n.t('base.paymentAgreement')}}</div>
        <div class="pop-base-content">
          <p v-html="AgreementPay"></p>
        </div>
        <div class="pop-base-bottom flex" @click="agreementPayShow = false">
        <van-button round type="danger" block color="var(--themeBaseColor)" style="height: 40px;">关闭</van-button>
      </div>
      </van-popup>
    </template>

    <!-- 快递地址选择器 -->
    <yz-address-list
      ref="yz_showAddressShop"
      :goodsStyle="false"
      v-model="showAddress"
      :center_path="locations"
      :path_list="delivery_area"
      v-on:confirm="confirmSelectAddress"
      :options="yzAddressListOptions"
    ></yz-address-list>
    <!-- 快递地址选择器 end -->

    <!--选择安装时间-->
    <van-popup v-model="showInstallPop" position="bottom">
      <van-datetime-picker v-model="installDate" type="datetime" @cancel="showInstallPop = false" @confirm="showInstallPop = false" title="选择完整时间" :min-date="minDate" />
    </van-popup>

    <!-- 地图选择器 -->
    <location v-model="showLocation" v-on:confirm="confirmLocation"></location>

    <!-- 配送时间 -->
    <cityDeliveryDay ref="deliveryTime" @confirm="cityDeliveryDayConfirm"></cityDeliveryDay>

    <!-- 计费规则 -->
    <van-popup v-model="costSpecShow" class="pop-base-class" position="bottom" round style="background-color: #F5F5F5;" closeable>
      <div class="pop-base-title">计费规格</div>
      <div class="pop-base-content t-l">
        <template v-if="cityDelivery && cityDelivery.price_setting">
          <div v-if="cityDelivery.price_setting.distance_setting">
            <div class="f-15 f-bold margin-top-10">按距离配送</div>
            <div class="flex margin-top-4" v-for="item in cityDelivery.price_setting.distance_setting" :key="item.level">
              <div style="flex: 1;">{{ item.level == 1 ? `${item.unit}公里内` : `范围${item.unit}公里` }}</div>
              <div class="t-r" style="flex: 1;">{{ item.level == 1 ? "起步价" : "每公里+" }} <span class="themeColor">￥ {{ item.amount }}</span></div>
            </div>
          </div>
          <div v-if="cityDelivery.price_setting.weight_setting">
            <div class="f-15 f-bold margin-top-10">按重量配送</div>
            <div class="flex margin-top-4" v-for="item in cityDelivery.price_setting.weight_setting" :key="item.level">
              <div style="flex: 1;">{{ item.level == 1 ? `${item.unit}KG内` : `范围${item.unit}KG` }}</div>
              <div class="t-r" style="flex: 1;">{{ item.level == 1 ? "起步价" : "每KG+" }} <span class="themeColor">￥ {{ item.amount }}</span></div>
            </div>
          </div>
          <div v-if="cityDelivery.price_setting.night_setting">
            <div class="f-15 f-bold margin-top-10">夜间配送</div>
            <div class="flex margin-top-4" v-for="item in cityDelivery.price_setting.night_setting" :key="item.level">
              <div style="flex: 1;">{{ item.start_time_str }}-{{ item.end_time_str }}</div>
              <div class="t-r" style="flex: 1;">服务费+ <span class="themeColor">￥ {{ item.amount }}</span></div>
            </div>
          </div>
        </template>
      </div>
      <div class="pop-base-bottom flex" @click="costSpecShow = false">
        <van-button round type="danger" block color="var(--themeBaseColor)" style="height: 40px;">关闭</van-button>
      </div>
    </van-popup>

    <!-- 配送范围 -->
    <template v-if="cityDelivery||is_show_store_delivery">
      <van-popup v-model="deliveryScopeShow" class="pop-base-class" position="bottom" round style="background-color: #F5F5F5;" closeable>
        <div class="pop-base-title">配送范围</div>
        <div style="padding:0 0.75rem;height: calc(70vh - 2.5rem);">
          <delivery-map :center_path="locations" :path_list="delivery_area" :address_name="address_name" :is_custom="is_custom"></delivery-map>
        </div>
        <div class="pop-base-bottom flex" @click="deliveryScopeShow = false">
        <van-button round type="danger" block color="var(--themeBaseColor)" style="height: 40px;">关闭</van-button>
      </div>
      </van-popup>
    </template>
    <!-- 选择社区 -->
    <van-popup v-model="selectCommunityShow" class="pop-base-class" position="bottom" round style="background-color: #F5F5F5;" closeable>
      <div class="pop-base-title">选择社区</div>
      <div class="pop-base-content t-l" style="padding-left: 0;padding-right: 0;">
        <van-radio-group v-model="cityDelivery_community_id" v-if="cityDelivery && cityDelivery.community_setting">
          <van-cell-group inset>
            <van-cell :title="item.name" @click="cityDelivery_community_id = item.id" v-for="item in cityDelivery.community_setting.community_list" :key="item.id" clickable>
              <template #right-icon>
                <van-radio :name="item.id" checked-color="var(--themeBaseColor)"/>
              </template>
            </van-cell>
          </van-cell-group>
        </van-radio-group>
      </div>
      <div class="pop-base-bottom flex" @click="setCityDeliveryCommunity">
        <van-button round type="danger" block color="var(--themeBaseColor)" style="height: 40px;">确定</van-button>
      </div>
    </van-popup>

    <template v-if="cloud_note">
      <van-popup v-model="noteShow" class="pop-base-class" position="bottom" round style="background-color: #F5F5F5;" closeable>
        <div class="pop-base-title">{{ cloud_note.name }}须知</div>
        <div class="pop-base-content">
          <div v-html="cloud_note.detail_desc"></div>
        </div>
        <div class="pop-base-bottom flex" @click="noteShow = false">
        <van-button round type="danger" block color="var(--themeBaseColor)" style="height: 40px;">关闭</van-button>
      </div>
      </van-popup>
    </template>

    <!-- 送达区域 -->
    <van-popup v-model="serviceRegionShow" class="pop-base-class" position="bottom" round style="background-color: #F5F5F5;" closeable>
      <div class="pop-base-title">可送达区域</div>
      <div class="pop-base-content">
        <div class="flex" v-if="cityDelivery && cityDelivery.area_setting" style="flex-wrap: wrap;">
          <div class="primary-btn" v-for="item in cityDelivery.area_setting.city_list" :key="item.id" style="margin: 0 10px 10px 0;">{{ item.areaname }}</div>
          <div class="primary-btn" v-for="item in cityDelivery.area_setting.district_list" :key="item.id" style="margin: 0 10px 10px 0;">{{ item.areaname }}</div>
          <div class="primary-btn" v-for="item in cityDelivery.area_setting.street_list" :key="item.id" style="margin: 0 10px 10px 0;">{{ item.areaname }}</div>
        </div>
      </div>
      <div class="pop-base-bottom flex" @click="serviceRegionShow = false">
      <van-button round type="danger" block color="var(--themeBaseColor)" style="height: 40px;">关闭</van-button>
    </div>
    </van-popup>


    <!-- 地址二维码插件弹窗 -->
    <van-popup v-model="codeShow" :style="{ height: '90vh' }" position="bottom" round>
      <div class="codeShowBox">
        <div class="vanNav">
          <van-nav-bar title="请确认信息" left-text="取消" :right-text="show_add_address?'新增地址':''" @click-left="codeShow = false" @click-right="onClickRight" />
        </div>
        <div class="main">
          <!-- 快递地址选择器 -->
          <yz-address-list ref="yz_showAddress" :goodsStyle="false" v-on:confirm="code_confirmSelectAddress" :options="yzAddressListOptions"></yz-address-list>
          <!-- 快递地址选择器 end -->
        </div>
      </div>
    </van-popup>
    <yz-address-list ref="yz_addressList" :goodsStyle="false" v-on:confirm="confirmSelectAddress" :options="yzAddressListOptions"></yz-address-list>
  </div>
</template>

<script>
import goods_order_controller from "./goods_order_controller";

export default goods_order_controller;
</script>

<style lang="scss" rel="stylesheet/scss" scoped>

.box-base {
  border-radius: 0.5rem;
  padding: 0.75rem;
  background: #fff;
  margin: 0.625rem;
  overflow: hidden;
}
::v-deep .van-cell {
  padding: 8px 12px;
}
::v-deep .van-cell-group--inset {
  margin: 0 10px;
}
::v-deep .van-cell__label {
  font-size: 12px;
  color: #6E6E79;
}

::v-deep .van-tab--active {
  font-weight: 600;
}
::v-deep .van-tabs__line {
  width: 15px;
  border-radius: 15px 15px 15px 15px;
  bottom: 20px;
}

::v-deep .van-stepper--round .van-stepper__plus{
  background-color: var(--themeBaseColor);
}
::v-deep .van-stepper--round .van-stepper__minus{
  color: var(--themeBaseColor);
  border-color: var(--themeBaseColor);
}

::v-deep .cell-group-padding {
  .van-cell {
    padding: 5px 0px;
  }
}

.pop-base-class {
  .pop-base-title {
    margin: 18px 12px 12px;
    font-size: 1rem;
    font-weight: bold;
    text-align: left;
  }
  .pop-base-content {
    min-height: 45vh;
    max-height: 55vh;
    overflow: scroll;
    padding: 0 0.75rem 5rem;
  }
  .pop-base-bottom {
    padding: 0.625rem 0.875rem;
    background: #ffffff;
  }
}
.disabled-block {
  filter: grayscale(100%);
  color: #999999;
  background: #eeeeee;
}

.primary-btn {
  padding: 0 12px;
  height: 32px;
  line-height: 32px;
  border-radius: 20px;
  border: 1px solid #D6D6DC;
}


::v-deep .van-sure {
  color: #fff;
  background-color: #f15353;
  border-color: #f15353;
  width: 80%;
  height: 2.5rem;
  line-height: 2.5rem;
  margin: 1.25rem 0;
  padding: 0;
  font-size: 16px;
}
::v-deep .van-cell--required::before {
  left: 4px;
}
</style>

<style lang="scss" rel="stylesheet/scss" scoped>
#goodsinfo {
  input {
    border: none;
  }

  .mint-popup-4 {
    width: 100%;

    .sure {
      background: #f15353;
      height: 3rem;
      line-height: 3rem;
      color: #fff;
      width: 50%;
      border: 0;
      float: left;
    }

    .close {
      background: #eee;
      height: 3rem;
      line-height: 3rem;
      color: #333;
      width: 50%;
      border: 0;
      float: left;
    }
    li {
      padding: 0.625rem 0;
      display: flex;
      position: relative;

      i {
        flex: 1;
      }
    }
  }


  .detail_good {
    overflow: hidden;
    .goods-top{
      display: flex;
      width:100%;
    }


    .diyFormDiv {
      padding: 4px 10px;
      background: rgba(241,83,83,0.08);
      border-radius: 6px 6px 6px 6px;
      color: #F15353;
    }

    a {
      color: #000;
    }

    .goods {
      .img {
        width: 5.375rem;
        img {
          display: block;
          margin: 0;
          width: 100%;
          border-radius: 10px;
          overflow: hidden;
        }
      }

      .warp {
        flex: 1;
        margin-left: 0.625rem;
        position: relative;
      }
    }
  }

  .rent-time {
    .week {
      display: flex;
      flex-wrap: wrap;

      button {
        display: inline-block;
        width: 29%;
        border: solid 1px #D6D6DC;
        color: #00001C;
        border-radius: 0.5rem;
        height: 3.75rem;
        margin-top: 0.625rem;
        margin-right: 0.75rem;
        font-size: 13px;

        .text {
          font-size: 12px;
        }
      }

      .active {
        border: solid 1px var(--themeBaseColor);
      }
    }
  }

  .detail_pay {
    z-index: 98;
    width: 100%;
    background: #fff;
    position: fixed;
    bottom: 0;
    box-sizing: border-box;

    .order_delete {
      width: 7.5rem;
      background: var(--themeBaseColor);
      text-align: center;
      color: #fff;
      line-height: 2.5rem;
      border-radius: 30px;
      position: relative;
      font-size: 0.9375rem;

      &.disabled {
        background: #a5a5a5;
      }
    }
  }
}

#goodsinfo.pcStyle {
  .detail_pay,
  .mint-popup-4 {
    width: 375px;
  }
}

.coupon_voucher_main {
  flex: 1;
  overflow: hidden;
  height: 5.625rem;
  margin-left: 0.75rem;
  margin-bottom: 0.625rem;
}

.dis_warn {
  margin: 0;
  padding: 6px 8px;
  background: rgba(241,83,83,0.08);
  border-radius: 5px 5px 5px 5px;
  color: #F15353;
}

#goodsinfo.pcStyle .van-popup--top {
  top: 0;
  right: 50% !important;
  left: unset;
  margin-right: -187.5px;
  width: 100%;
}

::v-deep .inp-field.van-cell {
  input::placeholder {
    color: #555;
  }
}


.cloud_service_notes{
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  .notes{
    margin-top: 0.35rem;
    margin-right: 0.5rem;
    font-size: 0.63rem;
    color: var(--themeBaseColor);
    font-weight: 400;
    padding: 0.13rem 0.19rem;
    box-sizing: border-box;
    background: #FFFFFF;
    border-radius: 0.13rem;
    border: 1px solid var(--themeBaseColor);
    line-height: 0.75rem;
    display: flex;
    align-items: center;
    .icon-advertise-next{
      font-size: 0.75rem;
      color: var(--themeBaseColor);
    }
  }
  .notes:last-child{
    margin-right: 0;
  }
}

.codeShowBox {
  height: 100%;
  display: flex;
  flex-direction: column;

  .main {
    height: 90vh;
    overflow-y: scroll;
  }
}
</style>
